﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace BluetoothManager
{
    public enum RadioMode
    {
        Off = 0,
        Connectable = 1,
        Discoverable = 2
    }
    
    public class BluetoothRadio
    {
        [DllImport("BthUtil.dll")]
        private static extern int BthGetMode(out RadioMode dwMode);

        [DllImport("BthUtil.dll")]
        private static extern int BthSetMode(RadioMode dwMode);

        public static RadioMode GetBluetoothRadioMode()
        {
            RadioMode radioMode = RadioMode.Off;

            BthGetMode(out radioMode);

            return radioMode;
        }

        public static int SetBluetoothRadioMode(RadioMode radioMode)
        {
            int ret = BthSetMode(radioMode);
            
            return ret;
        }
    }
}
